<HTML xmlns:IE><HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta NAME="GENERATOR">
<TITLE>页面设置</TITLE>
<style>
  .mask{ 
		BACKGROUND-COLOR: #ffebcd;
		BORDER-BOTTOM-WIDTH: 0px;
		BORDER-LEFT-WIDTH: 0px;
		BORDER-RIGHT-WIDTH: 0px;
		BORDER-TOP-WIDTH: 0px
	   } 
 .button{TEXT-DECORATION: underline;color:red;}
 .textbox{ 
             height:18;
	         color: maroon;
             BACKGROUND-COLOR: #efefef;
             BORDER-BOTTOM-WIDTH: 0px;
             BORDER-LEFT-WIDTH: 0px;
             BORDER-RIGHT-WIDTH: 0px;
             BORDER-TOP-WIDTH: 0px
         }
       
</style>

<SCRIPT language=javaScript src="public.js"></SCRIPT>

<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript >
//prnSet.repWidth和缓存中的单位为mm,在dsnprint.htm页面中的repWidth的单位为px
//此处的repWidth的单位为mm

	var bClickOk=false
	var userData=window.dialogArguments[6]
	var ReportName=window.dialogArguments[3]
	var repWidth=window.dialogArguments[7]
	var repHeight=window.dialogArguments[8]
	var pxRatemm=window.dialogArguments[9]
	var imgshow="none"
	var imgsrc=""

function cmdOk(){		
	if (check()==false) {
		return false;
	}
	else
	{
		var strTemp="";
		if (select1.selectedIndex==6){
			//自定义
			repWidth=definedWidth.value 
			repHeight=definedHeight.value
		}

		//缓存中的高宽的单位为mm
		strTemp="<root>"+"<selIndex>"+select1.selectedIndex+"</selIndex>"+
				"<repWidth>"+repWidth+"</repWidth>"+"<repHeight>"+repHeight+"</repHeight>"+
				"<portrait>"+portrait.checked +"</portrait>"+"<level>"+level.checked +"</level>"+
				"<CaptionTop>"+CaptionTop.value +"</CaptionTop>"+"<CaptionBottom>"+CaptionBottom.value +"</CaptionBottom>"+
				"<tabTop>"+tabTop.value +"</tabTop>"+"<tabBottom>"+tabBottom.value +"</tabBottom>"+
				"<tabLeft>"+tabLeft.value +"</tabLeft>"+"<tabRight>"+tabRight.value +"</tabRight>"+				
				"<tabHead>"+tabHead.value +"</tabHead>"+"<tabCauda>"+tabCauda.value +"</tabCauda>"+
				"<topOffset>"+topOffset.value +"</topOffset>"+"<leftOffset>"+leftOffset.value +"</leftOffset>"+"<coverPrint>"+coverPrint.checked  +"</coverPrint>"+"<AutoturnRow>"+AutoturnRow.checked +"</AutoturnRow>"+
				"<imgsrc>"+imgsrc+"</imgsrc>"+"<imgshow>"+printImg.checked+"</imgshow>"+"<imgLeft>"+imgLeft.value +"</imgLeft>"+"<imgTop>"+imgTop.value +"</imgTop>"
				+"<compressWidth>"+(compressWidth.checked?1:0)+"</compressWidth>"
				+"<compressHeight>"+(compressHeight.checked?1:0)+"</compressHeight>"
				+"<compressFont>"+(compressFont.checked?1:0)+"</compressFont>"
				+"<compressPrint>"+(compressPrint.checked?1:0)+"</compressPrint>"
				+"<offsetAdjust>"+offsetAdjust.value +"</offsetAdjust>"
				+"</root>"
			
		SaveUserData("setformat","Format"+ReportName,strTemp)
	
		bClickOk=true
		self.close() 
	}	
}
function cmdCancel(){
	self.close() 
}
function window_onload() {	
	var strXml=LoadUserData("setformat","Format"+ReportName)
	row2.style .display ="none"
	if (strXml!=""){
		var oXML1=new ActiveXObject("Microsoft.XMLDOM")
		oXML1.async="false";
		oXML1.loadXML(strXml)
		var selIndex=parseInt(oXML1.documentElement.childNodes.item(0).text)
		select1.options(selIndex).selected=true
		if (selIndex=="6"){
			row2.style .display ="block"
			definedWidth.style .display ="block"
			definedHeight.style .display ="block"
			definedWidth.value =oXML1.documentElement.childNodes.item(1).text
			definedHeight.value =oXML1.documentElement.childNodes.item(2).text
			
		}
	
		if (oXML1.documentElement.childNodes.item(3).text=="true"){
			portrait.checked =true
			level.checked =false
		}
		else {
			portrait.checked =false
			level.checked =true
		}
		CaptionTop.value =oXML1.documentElement.childNodes.item(5).text
		CaptionBottom.value =oXML1.documentElement.childNodes.item(6).text
		tabTop.value=oXML1.documentElement.childNodes.item(7).text
		tabBottom.value =oXML1.documentElement.childNodes.item(8).text
		tabLeft.value=oXML1.documentElement.childNodes.item(9).text
		tabRight.value =oXML1.documentElement.childNodes.item(10).text
		tabHead.value =oXML1.documentElement.childNodes.item(11).text
		tabCauda.value =oXML1.documentElement.childNodes.item(12).text
		topOffset.value =oXML1.documentElement.childNodes.item(13).text
		leftOffset.value =oXML1.documentElement.childNodes.item(14).text
		if (oXML1.documentElement.childNodes.item(15).text=="true"){
			coverPrint.checked=true
		}
		else {
			coverPrint.checked=false
		}
		if (oXML1.documentElement.childNodes.item(16).text=="true"){
			AutoturnRow.checked=true
		}
		else {
			AutoturnRow.checked=false
		}
		imgshow=oXML1.documentElement.childNodes.item(18).text
		imgsrc=oXML1.documentElement.childNodes.item(17).text
		if (imgsrc==""){
			formatImg.style .display ="none"
			TABLE1.style .top =370	
			TABLE1.style.display ="block"	
		}
		else {
			formatImg.style .display ="block"
			TABLE1.style.display ="block"
			
			if (imgshow=="false"){
				printImg.checked =false
				imgLeft.value =oXML1.documentElement.childNodes.item(19).text
				imgTop.value =oXML1.documentElement.childNodes.item(20).text
				
			}
			else if(imgshow=="true"){
				printImg.checked =true
				
				imgLeft.value =oXML1.documentElement.childNodes.item(19).text
				imgTop.value =oXML1.documentElement.childNodes.item(20).text
				
			}
		}
//new add
		try {
			if(oXML1.documentElement.childNodes.item(21).text=="1")
				compressWidth.checked =true
			if(oXML1.documentElement.childNodes.item(22).text=="1")
				compressHeight.checked =true
			if(oXML1.documentElement.childNodes.item(23).text=="1")
				compressFont.checked =true
			if(oXML1.documentElement.childNodes.item(24).text=="1")
				compressPrint.checked =true

			offsetAdjust.value =oXML1.documentElement.childNodes.item(25).text
		}
		catch (e){}
				
	}
	
}
function check(){
	if (isNaN(CaptionBottom.value)==true){
		alert("请输入数字!")
		CaptionBottom.focus ()
		CaptionBottom.value =""
		return false 
	}
	if (CaptionBottom.value==""){
		CaptionBottom.value=0
	}
	if (isNaN(tabBottom.value )==true){
		alert("请输入数字!")
		tabBottom.focus ()
		tabBottom.value =""
		return false 
	}
	if (tabBottom.value==""){
		tabBottom.value=0
	}
	if (isNaN(topOffset.value )==true){
		alert("请输入数字!")
		topOffset.focus ()
		topOffset.value =""
		return false 
	}
	if (topOffset.value==""){
		topOffset.value=0
	}
	if (isNaN(leftOffset.value )==true){
		alert("请输入数字!")
		leftOffset.focus ()
		leftOffset.value =""
		return false 
	}
	if (leftOffset.value==""){
		leftOffset.value=0
	}
	if (isNaN(offsetAdjust.value )==true){
		alert("请输入数字!")
		offsetAdjust.focus ()
		offsetAdjust.value =""
		return false 
	}
	if (offsetAdjust.value==""){
		leftOffset.value=0
	}
		
	if (isNaN(tabTop.value)==true){
		alert("请输入数字!")
		tabTop.focus ()
		tabTop.value =""
		return false 
		}
	if (tabTop.value ==""){
		tabTop.value =0
	}
	
	if (isNaN(tabLeft.value)==true){
		alert("请输入数字!")
		tabLeft.focus ()
		tabLeft.value =""
		return false 
	}
	if (tabLeft.value ==""){
		tabLeft.value =0
	}
	
	if (isNaN(tabRight.value)==true){
		alert("请输入数字!")
		tabRight.focus ()
		tabRight.value =""
		return false 
	}
	if (tabRight.value ==""){
		tabRight.value =0
	
	}
	
	
	if (isNaN(tabHead.value)==true){
		alert("请输入数字!")
		tabHead.focus ()
		return false 
	}
	if (tabHead.value ==""){
		tabHead.value =0
	}

	
	if (isNaN(tabCauda.value)==true){
		alert("请输入数字!")
		tabCauda.focus ()
		return false 
	}
	if (tabCauda.value ==""){
		tabCauda.value =0
	}
	
	if (isNaN(CaptionTop.value)==true ){
		alert("请输入数字!")
		CaptionTop.focus ()
		return false 
	}
	if (CaptionTop.value ==""){
		CaptionTop.value =0
	}
	if (parseInt(CaptionTop.value )<0){
		alert("请输入大于等于零的整数！")
		CaptionTop.focus()
		return false
	}
	if (coverPrint.checked ==true){
		coverPrint.value ="off"
	}
	
	if (isNaN(imgTop.value )==true){
		alert("请输入数字!")
		imgTop.focus ()
		return false 
	}
	if (imgTop.value ==""){
		imgTop.value ="0"
	}
	if (parseInt(imgTop.value )<0){
		imgTop.value ="0"
	}
	if (isNaN(imgLeft.value )==true){
		alert("请输入数字!")
		imgLeft.focus ()
		return false 
	}
	if (imgLeft.value ==""){
		imgLeft.value ="0"
	}
	if (parseInt(imgLeft.value )<0){
		imgLeft.value ="0"
	}

	if 	(select1.value=="自定义"){
		if (definedWidth.value <76.2 || definedWidth.value>215.9){
			alert("请输入76.2至215.9之间的数！")
			definedWidth.focus()
			return false
		}
		else {
			repWidth=parseFloat(definedWidth.value)*pxRatemm
			if (definedHeight.value <127||definedHeight.value >693.6){
				alert("请输入127至693.6之间的数！")
				definedHeight.focus ()
				return false
			}
			else{
				repHeight=parseFloat(definedHeight.value)*pxRatemm
			}
		}	
	}
	return true
}
function select1_onclick() {
	if (select1.value=="A4"){
		definedWidth.style .display ="none"
		definedHeight.style .display ="none"
		row2.style.display ="none"
		repWidth=210
		repHeight=297
				
	}
	else if (select1.value=="A3"){
		definedWidth.style .display ="none"
		definedHeight.style .display ="none"
		row2.style .display ="none"
		repWidth=299
		repHeight=428
	}
	else if (select1.value=="Letter"){
		definedWidth.style .display ="none"
		definedHeight.style .display ="none"
		row2.style .display ="none"
		repWidth=279.4
		repHeight=215.9
	}
	else if (select1.value=="Legal"){
		definedWidth.style .display ="none"
		definedHeight.style .display ="none"
		row2.style .display ="none"
		repWidth=215.9
		repHeight=355.6
	}
	else if (select1.value=="Exelutive"){
		definedWidth.style .display ="none"
		definedHeight.style .display ="none"
		row2.style .display ="none"
		repWidth=184.1
		repHeight=266.7
	}
	else if (select1.value=="B5"){
		definedWidth.style .display ="none"
		definedHeight.style .display ="none"
		row2.style .display ="none"
		repWidth=182
		repHeight=257
	}
	else if (select1.value=="自定义"){
		definedWidth.style .display ="block"
		definedHeight.style .display ="block"
		row2.style.display ="block"
		definedWidth.value ="76.2"
		definedHeight.value ="127"
		repWidth=parseFloat(definedWidth.value)
		repHeight=parseFloat(definedHeight.value)
	}
}



function portrait_onclick() {
	portrait.checked =true
	level.checked =false
	
}

function level_onclick() {
	portrait.checked =false
	level.checked =true
}



function cmdOk_onkeydown() {
	if (event.keyCode ==13){
		cmdOk()
	}
	if (event.keyCode ==27){
		cmdCancel()
	}
}

function window_onbeforeunload() {
		window.returnValue=bClickOk
}

//-->
</script>


</HEAD>

<BODY LANGUAGE=javascript  bgcolor="#ded5cf" onload="return window_onload()" onkeydown="return cmdOk_onkeydown()"  onbeforeunload="return window_onbeforeunload()">
<fieldset style="HEIGHT: 81px; LEFT: 18px; POSITION: absolute; TOP: 8px; WIDTH: 359px">
<legend style="FONT-SIZE: 12px" title="注意：此处的纸型设置要于浏览器文件菜单的页面设置中的纸型设置相一致辞。">纸型设置(S)</legend>&nbsp;&nbsp; 
<TABLE border=0 cellPadding=0 cellSpacing=0  style="HEIGHT: 52px; LEFT: 24px; POSITION: absolute; TOP: 17px" height="52" width="320">
  
  <TR >
    <TD colspan=7 width="308" align="middle"  >
      <SELECT id=select1 language=javascript 
      name=select1 onclick="return select1_onclick()" style="HEIGHT: 23px; WIDTH: 308px" >
      <OPTION value=A3>A3&nbsp;(299×428毫米)</OPTION> 
      <OPTION value=Letter>Letter&nbsp;(215.9×279.4毫米)</OPTION>
      <OPTION value=Legal>Legal&nbsp;(215.9×355.6毫米)</OPTION>
      <OPTION selected value=A4>A4&nbsp;(210×297毫米)</OPTION>
      <OPTION value=Exelutive>Exelutive&nbsp;(184.1×266.7毫米)</OPTION>
      <OPTION value=B5>B5(JIS)&nbsp;(182×257毫米)</OPTION>
      <OPTION value=自定义>自定义</OPTION></SELECT>
    </TD>
    </TR>
  <TR id=row2 style="FONT-SIZE: 12px">
    <TD width="38" >宽度：</TD>
    <TD width="44"><INPUT id=definedWidth  
      style="DISPLAY: none; HEIGHT: 18px; WIDTH: 50px"></TD>
    <TD width="53">毫米</TD>
    <td width="12"></td>
    <TD width="38" >高度：</TD>
    <TD width="50" ><INPUT id=definedHeight  
      style="DISPLAY: none; HEIGHT: 18px; WIDTH: 50px"></TD>
    <TD width="61" >毫米</TD></TR></TABLE>
  </fieldset>
  <fieldset style="FONT-SIZE: 12px; HEIGHT: 40px; LEFT: 17px; POSITION: absolute; TOP: 97px; WIDTH: 360px">
  <legend>［方向］</legend>
<TABLE border=0 cellPadding=1 cellSpacing=1 
style="FONT-SIZE: 12px; HEIGHT: 22px; LEFT: 0px; POSITION: absolute; TOP: 10px; 
WIDTH: 327px" width="75%">
  
  <TR>
    <TD style="WIDTH: 100px" width=100></TD>
    <TD align=middle  >纵向：<INPUT id=portrait language=javascript  checked
      onclick="return portrait_onclick()" type=radio> </TD>
    <TD align=middle  >横向：<INPUT id=level language=javascript  
      onclick="return level_onclick()" type=radio> </TD>
    <TD style="WIDTH: 100px" width=100></TD></TR></TABLE>
  
  </fieldset>
<fieldset style="HEIGHT: 213px; LEFT: 17px; POSITION: absolute; TOP: 143px; WIDTH: 360px"><legend style="FONT-SIZE: 12px">［报表设置］</legend>
<table  frame=box style="FONT-SIZE: 12px; HEIGHT:  83px; LEFT: 13px; POSITION: absolute; TABLE-LAYOUT: fixed; TOP: 27px; WIDTH: 330px" border ="0" bordercolorlight="#808080" bordercolordark="#efefef" cellPadding='0' cellSpacing='0' width="300">
  <tr style="DISPLAY: none">
    
    <td align="right" >表格名称：</td>
    <TD ><INPUT id=repName  
      style="DISPLAY: none; HEIGHT: 18px; 
     WIDTH: 50px" 
     ></TD>
    <TD ><INPUT id=CaptionTop 
       style="HEIGHT: 18px; WIDTH: 50px" height="18" ></TD>
    <td ><INPUT 
      id=CaptionBottom  style="HEIGHT: 22px; WIDTH: 50px"></td>
  </tr>
  <tr>
    
    <td align="right" >表格上边距：</td>
    <TD ><INPUT id=tabTop  
      style="HEIGHT: 18px; WIDTH: 50px" height="18" >毫米</TD>
    <TD align=right>表格左边距：</TD>
    <td   ><INPUT id=tabLeft 
      style="HEIGHT: 18px; WIDTH: 50px" height="18" >毫米</td>
  </tr>
  <TR>
    <TD align=right >表格下边距：</TD>
    <TD ><INPUT id=tabBottom  
      style="HEIGHT: 20px; WIDTH: 50px">毫米</TD>
    <TD  align=right>表格右边距：</TD>
    <TD ><INPUT id=tabRight 
      style="HEIGHT: 22px; WIDTH: 50px">毫米</TD></TR>
  <tr>
    
    <td align="right"    
     
   >表头行数：</td>
    <TD ><INPUT id=tabHead  
      style="HEIGHT: 18px; WIDTH: 50px" ></TD>
    <TD  align=right  
    
   >表尾行数：</TD>
    <td width="261"  ><INPUT id=tabCauda  
      style="HEIGHT: 18px; WIDTH: 50px" ></td>  
  </tr>  
  <tr>  
    <td align="right"  >上偏移量：</td>
    <TD ><INPUT id=topOffset  
      style="HEIGHT: 20px; WIDTH: 50px">毫米</TD>
    <TD  align=right>左偏移量：</TD>  
    <td   ><INPUT id=leftOffset  
      style="HEIGHT: 20px; WIDTH: 50px">毫米</td>  
  </tr>  
  <tr>  
    <td align="right"  >页距调整：</td>
    <TD ><INPUT id=offsetAdjust  
      style="HEIGHT: 20px; WIDTH: 50px">毫米</TD>
    <TD  align=right></TD>  
    <td ></td>  
  </tr>  

  <tr>  
    <td align="right" >套打：</td>
    <TD ><INPUT id=coverPrint type=checkbox> </TD>
    <TD  align=right  >转行：</TD>  
    <td ><INPUT id=AutoturnRow type=checkbox></td>   
  </tr> 
  <tr>  
    <td align="right" colspan=2 >超宽超高时不压缩字体：<INPUT id=compressFont type=checkbox></td>
    <td align="right" colspan=2 style="display:none">按预览比例打印：<INPUT id=compressPrint  type=checkbox></td>
  </tr> 
  <tr>  
    <td align="right" colspan=2 >表格超宽时压缩到一页：<INPUT id=compressWidth type=checkbox></td>
    <td align="right" colspan=2 >表格超高时压缩到一页：<INPUT id=compressHeight type=checkbox></td>
  </tr> 
</table> 
</fieldset>
<fieldset id=formatImg style="HEIGHT: 86px; LEFT: 17px; POSITION: absolute; TOP: 362px; WIDTH: 359px">
<legend style="FONT-SIZE: 12px" title="如果没有设置图片的路径，该项将不显示！">［图片设置］</legend>
<TABLE border=0 cellPadding=1 cellSpacing=1 width="75%" align=center style="FONT-SIZE: 12px; HEIGHT: 59px; LEFT: -1px; TOP: 14px; WIDTH: 356px">
  
  <TR>
    
    <TD  style="FONT-SIZE: 12px; 
      WIDTH: 100px" align=right width=100 title="该开关选中时，则表示打印图片，并可设置图片在页面中的位置，该开关没选中时，则表示不打印图片，并且不能设置图片在页面中的位置！"
   >是否打印图片：</TD>
      <td colspan=4 align=left><INPUT 
      id=printImg  type=checkbox ></td>
    </TR>
  <TR>
    <TD align=right  title="左边距是指图片在页面中离左边的距离！">左边距：</TD>
    <TD align=left><INPUT id=imgLeft  
      style="HEIGHT: 18px; WIDTH: 53px">毫米</TD>
    <TD width=20></TD>
    <TD  title="上边距是指图片在页面中离顶边的距离！">上边距：</TD>
    <TD><INPUT id=imgTop  
      style="HEIGHT: 18px; WIDTH: 54px">毫米</TD></TR>
  <TR>
    <TD colspan=5>注意：如想获得各项帮助，请将鼠标光标放在该项上。</TD>
    
    <TD></TD>
    <TD></TD></TR></TABLE>

</fieldset> 
<table  border=1 bgcolor=#f0c01a  bordercolordark="#ffe5d5" bordercolorlight="#808080" style="DISPLAY: block; HEIGHT: 17px; LEFT: 246px; POSITION: absolute; TOP: 460px" cellpadding=0 cellspacing=0 id=TABLE1> 
<tr> 
<td> 
<INPUT id=cmdOk  type=button style="BACKGROUND-COLOR: #f0c01a; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; CURSOR: hand; FONT-SIZE: 12px; HEIGHT: 17px;  WIDTH: 62px"  value="确  认" language=javascript onmouseover="this.className='button' " onmouseout="this.className=''" onclick="return cmdOk()"  > 
</td> 
<td> 
<INPUT id=cmdCancel type=button  style="BACKGROUND-COLOR: #f0c01a; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; CURSOR: hand; FONT-SIZE: 12px; HEIGHT: 17px;  WIDTH: 62px"   value="取  消" onmouseover="this.className='button' " onmouseout="this.className=''" onclick="return cmdCancel()">    
</td> 
</tr> 
</table>
</BODY>   
</HTML>   
